package org.xukai.remoting.ws.stringsoap;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.xukai.remoting.ws.jsonsoap.JsonService;

/**
 * @author xukai
 * @desc
 * @date 2016-09-27-下午 6:19
 */
public class cxfStringTest {

    public static void main(String[] args) {

        JaxWsProxyFactoryBean fac = new JaxWsProxyFactoryBean();
        fac.setServiceClass(StringService.class);
        fac.setAddress("http://127.0.0.1:8076/webServices2?groupName=test_20160927");

        fac.getInInterceptors().add(new LoggingInInterceptor());
        fac.getOutInterceptors().add(new LoggingOutInterceptor());
        StringService sv = (StringService) fac.create();

        String res = sv.demo(2);

//        String res = sv.demo("{'startDate':'20150615'}");
//        String res = sv.demo("<startDate>11</startDate>");
//        String res = sv.demo("<root><startDate>20160505</startDate></root>");
//        String res = sv.singleCheck("firstParam","secondParam");

        System.out.println(res);
    }
}
